home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gsfunc3.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  4.0 KB  |  109 lines

  1. /* Copyright (C) 1997, 1998 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gsfunc3.h,v 1.2 2000/09/19 19:00:28 lpd Exp $ */
  20. /* Definitions for LL3 Functions */
  21.  
  22. #ifndef gsfunc3_INCLUDED
  23. #  define gsfunc3_INCLUDED
  24.  
  25. #include "gsfunc.h"
  26. #include "gsdsrc.h"
  27.  
  28. /* ---------------- Types and structures ---------------- */
  29.  
  30. /*
  31.  * Define the Function types.
  32.  * See gsfunc.h for why gs_function_type_t can't be an enum type.
  33.  */
  34. enum {
  35.     function_type_ExponentialInterpolation = 2,
  36.     function_type_1InputStitching = 3,
  37.     /* For internal use only */
  38.     function_type_ArrayedOutput = -1
  39. };
  40.  
  41. /* Define Exponential Interpolation functions. */
  42. typedef struct gs_function_ElIn_params_s {
  43.     gs_function_params_common;
  44.     const float *C0;        /* n, optional */
  45.     const float *C1;        /* n, optional */
  46.     float N;
  47. } gs_function_ElIn_params_t;
  48.  
  49. #define private_st_function_ElIn()    /* in gsfunc.c */\
  50.   gs_private_st_suffix_add2(st_function_ElIn, gs_function_ElIn_t,\
  51.     "gs_function_ElIn_t", function_ElIn_enum_ptrs, function_ElIn_reloc_ptrs,\
  52.     st_function, params.C0, params.C1)
  53.  
  54. /* Define 1-Input Stitching functions. */
  55. typedef struct gs_function_1ItSg_params_s {
  56.     gs_function_params_common;
  57.     int k;
  58.     const gs_function_t *const *Functions;    /* k */
  59.     const float *Bounds;    /* k - 1 */
  60.     const float *Encode;    /* 2 x k */
  61. } gs_function_1ItSg_params_t;
  62.  
  63. #define private_st_function_1ItSg()    /* in gsfunc.c */\
  64.   gs_private_st_suffix_add3(st_function_1ItSg, gs_function_1ItSg_t,\
  65.     "gs_function_1ItSg_t", function_1ItSg_enum_ptrs, function_1ItSg_reloc_ptrs,\
  66.     st_function, params.Functions, params.Bounds, params.Encode)
  67.  
  68. /*
  69.  * Define Arrayed Output functions.  These consist of n m x 1 functions
  70.  * whose outputs are assembled into the output of the arrayed function.
  71.  * We use them to handle certain PostScript constructs that can accept
  72.  * either a single n-output function or n 1-output functions.
  73.  *
  74.  * Note that for this type, and only this type, both Domain and Range
  75.  * are ignored (0).
  76.  */
  77. typedef struct gs_function_AdOt_params_s {
  78.     gs_function_params_common;
  79.     const gs_function_t *const *Functions;    /* n */
  80. } gs_function_AdOt_params_t;
  81.  
  82. #define private_st_function_AdOt()    /* in gsfunc.c */\
  83.   gs_private_st_suffix_add1(st_function_AdOt, gs_function_AdOt_t,\
  84.     "gs_function_AdOt_t", function_AdOt_enum_ptrs, function_AdOt_reloc_ptrs,\
  85.     st_function, params.Functions)
  86.  
  87. /* ---------------- Procedures ---------------- */
  88.  
  89. /* Allocate and initialize functions of specific types. */
  90. int gs_function_ElIn_init(P3(gs_function_t ** ppfn,
  91.                  const gs_function_ElIn_params_t * params,
  92.                  gs_memory_t * mem));
  93. int gs_function_1ItSg_init(P3(gs_function_t ** ppfn,
  94.                   const gs_function_1ItSg_params_t * params,
  95.                   gs_memory_t * mem));
  96. int gs_function_AdOt_init(P3(gs_function_t ** ppfn,
  97.                  const gs_function_AdOt_params_t * params,
  98.                  gs_memory_t * mem));
  99.  
  100. /* Free parameters of specific types. */
  101. void gs_function_ElIn_free_params(P2(gs_function_ElIn_params_t * params,
  102.                      gs_memory_t * mem));
  103. void gs_function_1ItSg_free_params(P2(gs_function_1ItSg_params_t * params,
  104.                       gs_memory_t * mem));
  105. void gs_function_AdOt_free_params(P2(gs_function_AdOt_params_t * params,
  106.                      gs_memory_t * mem));
  107.  
  108. #endif /* gsfunc3_INCLUDED */
  109.